import { ArticleDetail } from '@/types/data'
import { ArticleAction } from '@/types/store'

const initValue = {
  info: {} as ArticleDetail,
}
const getArticleInfo = (prevState = initValue, action: ArticleAction) => {
  switch (action.type) {
    case 'articel/getArticleDetail':
      return {
        ...prevState,
        info: action.payload,
      }
    default:
      return prevState
  }
}

export default getArticleInfo
